Study Notebook Of Bond Stock CorrelationΒΆ
Download Bond DataΒΆ
| DGS1MO | DGS3MO | DGS1 | DGS2 | DGS5 | DGS10 | DGS30 | |
|---|---|---|---|---|---|---|---|
| DATE | |||||||
| 1962-01-02 | NaN | NaN | 3.22 | NaN | 3.88 | 4.06 | NaN |
| 1962-01-03 | NaN | NaN | 3.24 | NaN | 3.87 | 4.03 | NaN |
| 1962-01-04 | NaN | NaN | 3.24 | NaN | 3.86 | 3.99 | NaN |
| 1962-01-05 | NaN | NaN | 3.26 | NaN | 3.89 | 4.02 | NaN |
| 1962-01-08 | NaN | NaN | 3.31 | NaN | 3.91 | 4.03 | NaN |
| ... | ... | ... | ... | ... | ... | ... | ... |
| 2025-06-16 | 4.24 | 4.43 | 4.10 | 3.97 | 4.04 | 4.46 | 4.96 |
| 2025-06-17 | 4.23 | 4.42 | 4.10 | 3.94 | 3.99 | 4.39 | 4.88 |
| 2025-06-18 | 4.20 | 4.42 | 4.10 | 3.94 | 3.98 | 4.38 | 4.88 |
| 2025-06-19 | NaN | NaN | NaN | NaN | NaN | NaN | NaN |
| 2025-06-20 | 4.20 | 4.39 | 4.07 | 3.90 | 3.96 | 4.38 | 4.89 |
16559 rows Γ 7 columns
Download Inflation DataΒΆ
ParametersΒΆ
US Bond Annualized Volatility Vs It's Yield TermΒΆ
Mean and Median Annual Vol. of US Bond in Decadal PeriodsΒΆ
Mean and Median Annual Vol. of S&P500 in Decadal PeriodsΒΆ
Calculate ReturnsΒΆ
Calculate Correlation and VolatilityΒΆ
| corr | vol_bond | vol_stock | |
|---|---|---|---|
| 1970-02-28 | NaN | NaN | NaN |
| 1970-03-31 | NaN | NaN | NaN |
| 1970-04-30 | NaN | NaN | NaN |
| 1970-05-31 | NaN | NaN | NaN |
| 1970-06-30 | NaN | NaN | NaN |
| ... | ... | ... | ... |
| 2025-02-28 | 0.602267 | 0.028993 | 0.046418 |
| 2025-03-31 | 0.602329 | 0.028793 | 0.047201 |
| 2025-04-30 | 0.595878 | 0.028764 | 0.046799 |
| 2025-05-31 | 0.572312 | 0.028823 | 0.047437 |
| 2025-06-30 | 0.570876 | 0.028722 | 0.047388 |
665 rows Γ 3 columns
Set Weights: Constant Mix 60/40 PortfolioΒΆ
Calculate Risk Premiums and Sharpe of 60/40 PortfolioΒΆ
| premium | corr | |
|---|---|---|
| 1970-02-28 | NaN | NaN |
| 1970-03-31 | NaN | NaN |
| 1970-04-30 | NaN | NaN |
| 1970-05-31 | NaN | NaN |
| 1970-06-30 | NaN | NaN |
| ... | ... | ... |
| 2025-02-28 | 0.068235 | 0.602267 |
| 2025-03-31 | 0.054583 | 0.602329 |
| 2025-04-30 | 0.049591 | 0.595878 |
| 2025-05-31 | 0.056154 | 0.572312 |
| 2025-06-30 | 0.055749 | 0.570876 |
665 rows Γ 2 columns
Risk PremiumΒΆ
Risk Premium of Bonds vs Correlation between Stocks and BondsΒΆ
Bond and Stock Performance in a given yearΒΆ
Performance of Bonds, Stocks and 40/60 Constant Mix During 80-90 and 2000 onwardsΒΆ
Explaning the Bond-Stock CorrelationΒΆ
| Dep. Variable: | corr | R-squared: | 0.454 |
|---|---|---|---|
| Model: | OLS | Adj. R-squared: | 0.453 |
| Method: | Least Squares | F-statistic: | 359.8 |
| Date: | Tue, 24 Jun 2025 | Prob (F-statistic): | 8.24e-59 |
| Time: | 08:58:22 | Log-Likelihood: | -41.264 |
| No. Observations: | 434 | AIC: | 86.53 |
| Df Residuals: | 432 | BIC: | 94.67 |
| Df Model: | 1 | ||
| Covariance Type: | nonrobust |
| coef | std err | t | P>|t| | [0.025 | 0.975] | |
|---|---|---|---|---|---|---|
| const | -0.3923 | 0.027 | -14.624 | 0.000 | -0.445 | -0.340 |
| DGS10 | 0.0755 | 0.004 | 18.969 | 0.000 | 0.068 | 0.083 |
| Omnibus: | 18.010 | Durbin-Watson: | 0.043 |
|---|---|---|---|
| Prob(Omnibus): | 0.000 | Jarque-Bera (JB): | 19.491 |
| Skew: | 0.510 | Prob(JB): | 5.86e-05 |
| Kurtosis: | 2.803 | Cond. No. | 14.4 |
Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
| Dep. Variable: | corr | R-squared: | 0.000 |
|---|---|---|---|
| Model: | OLS | Adj. R-squared: | -0.002 |
| Method: | Least Squares | F-statistic: | 0.05077 |
| Date: | Tue, 24 Jun 2025 | Prob (F-statistic): | 0.822 |
| Time: | 08:58:22 | Log-Likelihood: | -245.63 |
| No. Observations: | 618 | AIC: | 495.3 |
| Df Residuals: | 616 | BIC: | 504.1 |
| Df Model: | 1 | ||
| Covariance Type: | nonrobust |
| coef | std err | t | P>|t| | [0.025 | 0.975] | |
|---|---|---|---|---|---|---|
| const | 0.0567 | 0.015 | 3.911 | 0.000 | 0.028 | 0.085 |
| bond | 0.1043 | 0.463 | 0.225 | 0.822 | -0.805 | 1.013 |
| Omnibus: | 1179.738 | Durbin-Watson: | 0.012 |
|---|---|---|---|
| Prob(Omnibus): | 0.000 | Jarque-Bera (JB): | 46.351 |
| Skew: | -0.150 | Prob(JB): | 8.61e-11 |
| Kurtosis: | 1.693 | Cond. No. | 31.9 |
Notes:
[1] Standard Errors assume that the covariance matrix of the errors is correctly specified.
Bond-Stock Optimal PortfolioΒΆ
Calculate the minimal-variance portfolio
$$ w_{B} = \frac{\sigma^2_S - \sigma_S \sigma_B \rho}{\sigma^2_S + \sigma^2_B - 2 \sigma_S \sigma_B \rho}\\ w_{S} = 1 - w_{B} $$
The portfolio of the current month, uses the mean $\rho$, $\sigma_S$ and $\sigma_B$ from the previous month.
| bond | stock | |
|---|---|---|
| 1970-02-28 | NaN | NaN |
| 1970-03-31 | NaN | NaN |
| 1970-04-30 | NaN | NaN |
| 1970-05-31 | NaN | NaN |
| 1970-06-30 | NaN | NaN |
| ... | ... | ... |
| 2025-02-28 | 0.998848 | 0.001152 |
| 2025-03-31 | 0.978115 | 0.021885 |
| 2025-04-30 | 0.992661 | 0.007339 |
| 2025-05-31 | 0.982130 | 0.017870 |
| 2025-06-30 | 0.968169 | 0.031831 |
665 rows Γ 2 columns
PerformanceΒΆ
| 60/40 | Din | |
|---|---|---|
| 1980-2000 | 0.489929 | 0.361126 |
| 2000-2020 | 0.133496 | 0.145078 |